home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2245 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.1 KB

  1. Path: news.ccs.queensu.ca!qlink!3mal5
  2. From: 3mal5@qlink.queensu.ca (Lepage Marc A)
  3. Newsgroups: comp.lang.c++
  4. Subject: Callbacks using member functions
  5. Date: 16 Jan 1996 16:43:58 GMT
  6. Organization: Queen's University, Kingston
  7. Message-ID: <4dgkke$8mf@knot.queensu.ca>
  8. NNTP-Posting-Host: qlink.queensu.ca
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. I am writing a MOTIF application, and I wish to use classes for the 
  12. various elements of my program.  MOTIF is C, and uses callbacks.  I want 
  13. to install member functions as the callbacks, but g++ complains, I 
  14. suspect because of the implicit 'this' parameter.  Is there a way to get 
  15. this to work (ie, why can't the compiler straighten everything out)?
  16.  
  17. I expect that I cannot use a member function as a callback, but wish to 
  18. confirm this before I go ahead and start using friend functions.
  19.  
  20. So on a related note, if I use friends, what is the best way to make sure 
  21. I have access to the proper class instances, without the 'this' parameter?
  22.  
  23. Does anyone have any recommendations to structuring MOTIF applications 
  24. with C++, and an object-oriented approach?
  25.  
  26. --
  27. Wintermute
  28.